var oInput = document.querySelectorAll(".txt")
var oSpan = document.querySelectorAll(".yz")
var reg = /^[1][3,4,5,7,8,9][0-9]{9}$/;
oInput[0].onblur = function() {
    var val1 = oInput[0].value;
    if (reg.test(val1)) {
        oSpan[0].innerText = "格式正确";
    } else {
        oSpan[0].innerText = "格式错误";
    }
}
var reg1 = /^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&*]+$)[a-zA-Z\d!@#$%^&*]+$/;
oInput[1].onblur = function() {
    var val2 = oInput[1].value;
    if (reg1.test(val2)) {
        oSpan[1].innerText = "格式正确";
    } else {
        oSpan[1].innerText = "格式错误";
    }
}
var reg2 = /^(?:\d+|[a-zA-Z]+|[!@#$%^&*]+)$/;
oInput[2].onblur = function() {
    var val3 = oInput[2].value;
    if (reg2.test(val3)) {
        oSpan[2].innerText = "格式正确";
    } else {
        oSpan[2].innerText = "格式错误";
    }
}
var reg3 = /^(?:\d+|[a-zA-Z]+|[!@#$%^&*]+)$/;
oInput[3].onblur = function() {
    var val4 = oInput[3].value;
    if (reg3.test(val4)) {
        oSpan[3].innerText = "格式正确";
    } else {
        oSpan[3].innerText = "格式错误";
    }
}
var reg4 = /^(\w){6,20}$/;
oInput[4].onblur = function() {
    var val4 = oInput[4].value;
    if (reg4.test(val4)) {
        oSpan[4].innerText = "格式正确";
    } else {
        oSpan[4].innerText = "格式错误";
    }
}